#ifndef __INTEGER_
#define __INTEGER_

namespace math 
{
template <int value_> class integer 
{
public:
	integer (){}
	static const int value = value_ ; 
	typedef integer<value_ + 1> next ; 
	typedef integer<value_ + 1> prior ;
	operator int() const  {return value_;}

};

template <int a, int b>
	integer <a + b> operator + (const integer <a> & lhs, const integer <b> & rhs)
{
	return integer <a+b> ();
}

template <int a, int b>
	integer <a - b> operator + (const integer <a> & lhs, const integer <b> & rhs)
{
	return integer <a - b> ();
}

template <bool> struct bool_impl {};

template <>
struct bool_impl<true>
{
	static void null_fun () {}
};



template <int a, int b>
	bool operator < (const integer <a> & lhs, const integer <b> & rhs) 
{
	return bool_impl< a < b>::null_fun();
}


template <int a, int b>
	bool operator > (const integer <a> & lhs, const integer <b> & rhs) 
{
	return bool_impl< (a > b )>::null_fun();
}


} // end math

/*
encapsulation counter 
template <unsigned num> struct fc 
{
	static fc <num - 1> fun (int value) 
	{
		std::cout<<"Cascade "<<num<<" value "<<value<<std::endl;
		return fc <num - 1> (); 
	}
};

template <> struct fc <0> {};

template <unsigned num>
fc <num - 1> f (const fc <num> & obj, int value )
{
	fc<num>::fun(value);
	return fc <num - 1> (); 
} 
 
// f (f (f (fc <3> (), 1), 2), 3);
*/

#endif





